<?php
/**
 * Copyright © 2013-2017 Magento, Inc. All rights reserved.
 * See COPYING.txt for license details.
 */

// @codingStandardsIgnoreFile

/**
USAGE:

Simple:

<?php 
echo $block->getLayout()->createBlock('Magento\Customer\Block\Widget\Dob')
    ->setDate($block->getCustomer()->getDob())
    ->toHtml() 
?>

For checkout/onepage/billing.phtml:

<?php 
echo $block->getLayout()->createBlock('Magento\Customer\Block\Widget\Dob')
   ->setDate($block->getCustomer()->getDob())
   ->setFieldIdFormat('billing:%s')
   ->setFieldNameFormat('billing[%s]')
   ->toHtml() 
?>

NOTE: Regarding styles - if we leave it this way, we'll move it to boxes.css
      Alternatively we could calculate widths automatically using block input parameters.
*/

/**
 * @see \Magento\Customer\Block\Widget\Dob
 */
?>
<?php
$fieldCssClass = 'field date field-' . $block->getHtmlId();
$fieldCssClass .= $block->isRequired() ? ' required' : '';
?>
<div class="<?php echo $this->helper(\Magento\Framework\EscapeHelper::class)->escapeHtmlAttr($fieldCssClass); ?>">
    <label class="label" for="<?php echo $this->helper(\Magento\Framework\EscapeHelper::class)->escapeHtmlAttr($block->getHtmlId())?>"><span><?php echo $block->escapeHtml($block->getLabel()) ?></span></label>
    <div class="control customer-dob">
        <?php echo $block->getFieldHtml(); ?>
        <?php if ($_message = $block->getAdditionalDescription()) : ?>
            <div class="note"><?php echo $block->escapeHtml($_message); ?></div>
        <?php endif; ?>
    </div>
</div>
